{extend name="../../admin/view/main"}

{block name="button"}

<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal='{:url("add")}' data-title="添加">添加</button>
<!--{/if}-->


{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='icon_carousel/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th width="180px" class='text-left nowrap'>ID</th>
            <th width="180px" class='text-left nowrap'>图标</th>
            <th width="180px" class='text-left nowrap'>链接</th>
            <th width="180px" class='text-left nowrap'>标题</th>
            <th width="180px" class='text-left nowrap'>排序</th>
            <th width="180px" class='text-left nowrap'>状态</th>
            <th width="180px" class='text-left nowrap'>创建时间</th>
            <th width="80px"></th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='text-left nowrap'>
                {$vo.id|default=''}
            </td>
            <td class='text-left nowrap'>
                <div class="headimg" data-tips-image data-lazy-src="{$vo.img|default=''}"></div>
            </td>
            <td class='text-left nowrap'>
                {$vo.imgurl|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.title|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.sort|default=''}
            </td>

            <td class='text-left nowrap'>
                {eq name='vo.status' value='0'}<span style="color: black">无效</span>{else}<span style="color: green">正常</span>{/eq}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|default=''}
            </td>
            <td class="nowrap">
                <!--{if auth("edit")}-->
                <a class="layui-btn layui-btn-xs" data-modal="{:url('edit')}?id={$vo.id}" data-value="id#{$vo.id}">编 辑</a>
                <!--{/if}-->

                <!--{if auth('state') and $vo.status eq 0}-->
                <a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">启用</a>
                <!--{elseif auth('state') and $vo.status eq 1}-->
                <a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" >禁用</a>
                <!--{/if}-->

                <!--{if auth("remove")}-->
                <a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}?id={$vo.id}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                <!--{/if}-->

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
